<template>
    <el-dialog
        :title="title"
        :visible.sync="showModal"
        :close-on-click-modal="false"
        :width="width"
        :destroy-on-close="true"
        :before-close="cancel"
    >
        <slot></slot>
    </el-dialog>
</template>

<script>
export default {
    props: {
        title: String,
        show: Boolean,
        width: String,
        cancel: Function,
    },
    data() {
        return {
            showModal: false,
        }
    },
    watch: {
        show(val) {
            this.showModal = val
        }
    }
}
</script>

<style>
</style>